package com.hyc.serviceCenter.loadbalance.impl;

import com.hyc.serviceCenter.loadbalance.LoadBalance;

import java.util.List;

/**
 * @author 冷环渊
 * @date 2025/6/11 21:19
 * @description RoundLoadBalance
 */
public class RoundLoadBalance implements LoadBalance {
    private int flag = -1;

    @Override
    public String balance(List<String> list) {
        flag++;
        flag = flag % list.size();
        System.out.println("轮询到哪一个地址了" + list.get(flag));
        return list.get(flag);
    }
}
